package com.webchat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author 程序员七七， https://www.coderutil.com网站作者
 * @date 2024/11/9 03:53
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum WalletTransTypeEnum {

    INCOME(1, "收入"),

    EXPENSES(-1, "支出");

    private Integer transType;

    private String transTypeName;


    public static String getTransTypeName(Integer transType) {
        if (transType == null) {
            return "未知";
        }
        for (WalletTransTypeEnum walletTransTypeEnum : WalletTransTypeEnum.values()) {
            if (walletTransTypeEnum.getTransType().equals(transType)) {
                return walletTransTypeEnum.getTransTypeName();
            }
        }
        return "未知";
    }
}
